package opensocial4gwt;


public final class Person extends BaseJsObject {
	public static enum Field {
		ID, NAME, NICKNAME, THUMBNAIL_URL, PROFILE_URL, CURRENT_LOCATION, ADDRESSES, EMAILS, PHONE_NUMBERS, ABOUT_ME, STATUS, PROFILE_SONG, PROFILE_VIDEO, GENDER, SEXUAL_ORIENTATION, RELATIONSHIP_STATUS, AGE, DATE_OF_BIRTH, BODY_TYPE, ETHNICITY, SMOKER, DRINKER, CHILDREN, PETS, LIVING_ARRANGEMENT, TIME_ZONE, LANGUAGES_SPOKEN, JOBS, JOB_INTERESTS, SCHOOLS, INTERESTS, URLS, MUSIC, MOVIES, TV_SHOWS, BOOKS, ACTIVITIES, SPORTS, HEROES, QUOTES, CARS, FOOD, TURN_ONS, TURN_OFFS, TAGS, ROMANCE, SCARED_OF, HAPPIEST_WHEN, FASHION, HUMOR, LOOKING_FOR, RELIGION, POLITICAL_VIEWS, HAS_APP, NETWORK_PRESENCE;

		public native String value() /*-{
			return $wnd.opensocial.Person.Field[this.@opensocial4gwt.Person.Field::name()()];
		}-*/;
	}

	protected Person() {
	}

	public native String getId() /*-{
		return this.getId();
	}-*/;

	public native String getDisplayName() /*-{
		return this.getDisplayName();
	}-*/;

	public native boolean isViewer() /*-{
		return this.isViewer();
	}-*/;

	public native boolean isOwner() /*-{
		return this.isOwner();
	}-*/;
	
	public Name getName() {
		return JsObject.cast(getFieldJsObject(Field.NAME.value())); 
	}
	
	public String getNickname() {
		return getFieldString(Field.NICKNAME.value());
	}
	
	public String getThumbnailUrl() {
		return getFieldString(Field.THUMBNAIL_URL.value());
	}
	
	public String getProfileUrl() {
		return getFieldString(Field.PROFILE_URL.value());
	}
	
	public Address getCurrentLocation() {
		return JsObject.cast(getFieldJsObject(Field.CURRENT_LOCATION.value())); 
	}
	
	public Address[] getAddresses() {
		JsObject jsArray = getFieldJsObject(Field.ADDRESSES.value());
		if (jsArray == null)
			return null;
		return (Address[]) jsArray.toJavaScriptObjectArray();
	}
	
	//email
	
	//phone
	
	public String getAboutMe() {
		return getFieldString(Field.ABOUT_ME.value());
	}
	
	public String getStatus() {
		return getFieldString(Field.STATUS.value());
	}
	
	public Url getProfileSong() {
		return JsObject.cast(getFieldJsObject(Field.PROFILE_SONG.value()));
	}
	
	public Url getProfileVideo() {
		return JsObject.cast(getFieldJsObject(Field.PROFILE_SONG.value()));
	}
	
	public Enum<Enum.Gender> getGender() {
		return JsObject.cast(getFieldJsObject(Field.GENDER.value()));
	}
}
